import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
class Main{

    public static void main(String[] args) {
       Student s = new Student("xiaoming",99);
        Student s2 = new Student("xiaoming2",911);
        Student s3 = new Student("xiaoming",911);
       Map<String,Student> map = new HashMap<>();
       map.put("xiaoming",s);
       map.put("xiaoming2",s2);
        map.put("xiaoming3",s3);
        System.out.println("s hash:"+s.hashCode());
       Student target = map.get("xiaoming2");
       System.out.println(target);
       System.out.println(target.score);
       for(String key:map.keySet()){
           Student value = map.get(key);
           System.out.println(key+"="+value.score);
       }
        System.out.println(s.name);
        System.out.println(s.name.equals("xiaoming3"));
        System.out.println(s.name.equals(s3.name));
    }
}
class Student{
    public String name;
    public int score;
    public Student(String name,int score){
        this.name=name;
        this.score=score;
    }
    @Override
    public int hashCode(){
        int h = 0;
        h = 31+h+name.hashCode();
        h = 31+h+score;
        return h;
    }
}